<template>
  <div>
    <div v-if="error.statusCode==404" class="error-page">
      404页面不存在
    </div>
    <div v-else class="error-page">
      500服务器错误
    </div>
  </div>
</template>

<script>
export default {
  props: {
    error: {
      type: Object,
      default: () => { }
    }
  },
  created() {
    if (this.$route.path === '/500/') {
      this.error.statusCode = 500
    }
  },
  mounted() {
    console.log(this.error.statusCode)
  }
}
</script>

<style lang="scss">
.error-page {
  height: 20vh;
  line-height: 20vh;
  text-align: center;
  color: #666;
}
</style>

